package com.example.flshtarvel.mapper;

import com.example.flshtarvel.entity.ArticleCollectMap;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ArticleCollectMapMappper {
    //信息收藏
    @Insert("insert into article_collect_map(article_id,user_id) values(#{articleId},#{userId})")
    public int articleCollect(String articleId,String userId);

    //取消信息收藏
    @Delete("delete from article_collect_map where article_id=#{articleId} and user_id=#{userId}")
    public int deleteArticleCollect(String articleId,String userId);

    //查询信息收藏 通过信息id  用户id
    @Select("select * from article_collect_map where article_id=#{articleId} and user_id=#{userId}")
    public ArticleCollectMap selectArticleCollectByArticleIdAndUserId(String articleId, String userId);
}
